package com.lagou.cluster.config;

import com.lagou.cluster.filter.SessionInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

/**
 * @ProjectName: S2-2
 * @Title: SessionConfiguration
 * @Package: com.lagou.cluster.config
 * @Description: 拦截器配置
 * @author: Ian
 * @date: 2021-04-01 16:26
 * @version: V1.0.0
 */

@Configuration
public class MyWebConfiguration implements WebMvcConfigurer {

    /**
     * 拦截器配置
     *
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        SessionInterceptor sessionInterceptor = new SessionInterceptor();
        registry.addInterceptor(sessionInterceptor).addPathPatterns("/**")
                .excludePathPatterns("/login", "/check_user_login");
        WebMvcConfigurer.super.addInterceptors(registry);
    }
}
